import styles from './index.module.scss'

interface EditListPropsType {
  onClose?: () => void
  type: 'photo' | 'gender' | ''
  onUpdate?: (type: string, value: number) => void
}

const genderList = [
  { title: '男', value: 1 },
  { title: '女', value: 0 },
]

const photoList = [
  { title: '拍照', value: 0 },
  { title: '本地选择', value: 0 },
]

const EditList = ({ onClose, type, onUpdate }: EditListPropsType) => {
  return (
    <div className={styles.root}>
      {/* <div className="list-item">男</div>
      <div className="list-item">女</div>

      <div className="list-item">本地选择</div>
      <div className="list-item">拍照</div> */}

      {(type === 'gender' ? genderList : photoList).map((item) => {
        return (
          <div
            className="list-item"
            key={item.title}
            onClick={() => {
              onUpdate?.(type, item.value)
            }}
          >
            {item.title}
          </div>
        )
      })}

      <div className="list-item" onClick={onClose}>
        取消
      </div>
    </div>
  )
}

export default EditList
